package com.zmn.oms.persistence.interfaces.fcorderpart;

import com.zmn.oms.model.entity.fcorderpart.FcOrderPartQuery;
import com.zmn.oms.model.entity.fcorderpart.OrderFactoryPart;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface OrderFactoryPartDao {

    List<OrderFactoryPart> listEsOrderFactoryPartByOrderIdList(@Param("orderIdList") List<Long> orderIdList);

    List<OrderFactoryPart> listOrderFactoryPartByOrderId(Long orderId);

    /**
     * 通过订单id和申请方式查询厂商配件
     * @param orderId
     * @param applyType
     * @return
     */
    List<Integer> listIdPartByOrderIdAndApplyType(@Param("orderId") Long orderId,
                                                            @Param("applyType") Integer applyType);

    int deleteByOrderId(Long orderId);

    int insertAll(List<OrderFactoryPart> partList);

    int insert(OrderFactoryPart part);

    int countByOrderId(Long orderId);

    void update(OrderFactoryPart orderFactoryPart);

    void updateBatch(List<OrderFactoryPart> partList);

    List<OrderFactoryPart> listPageByQuery(FcOrderPartQuery fcOrderPartQuery);

    Integer countByQuery(FcOrderPartQuery fcOrderPartQuery);

    OrderFactoryPart findByKey(Integer fcOrderPartId);

    void deleteByKey(Integer fcOrderPartId);

    /**
     * 通过主键批量删除
     * @param idList
     * @return void
     * @author wangxiaokun
     */
    void deleteByFcOrderPartIds(@Param("idList") List<Integer> idList);

    List<OrderFactoryPart> listByQuery(FcOrderPartQuery fcOrderPartQuery);

    List<OrderFactoryPart> listByIds(List<Integer> idList);
}